import Clients from "./clients";

export var clients = null;

export function initClients(server){
  clients = new Clients(server);
  
  clients.on("foo", {}, async data=>{
    console.log("foo!");
    console.log(data);
  });

  clients.on("bar", {}, async data=>{
    console.log(data);
    console.log("bar!");

    clients.reply(data.token, "bar", {
      replyId:data.emitId,
      ok:1
    })
  })
}
